{
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.6"
  },
  "orig_nbformat": 2,
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3",
   "language": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2,
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Copyright (c) 2010-2020 Benjamin Peterson\n",
    "#\n",
    "# Permission is hereby granted, free of charge, to any person obtaining a copy\n",
    "# of this software and associated documentation files (the \"Software\"), to deal\n",
    "# in the Software without restriction, including without limitation the rights\n",
    "# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n",
    "# copies of the Software, and to permit persons to whom the Software is\n",
    "# furnished to do so, subject to the following conditions:\n",
    "#\n",
    "# The above copyright notice and this permission notice shall be included in all\n",
    "# copies or substantial portions of the Software.\n",
    "#\n",
    "# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n",
    "# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n",
    "# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n",
    "# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n",
    "# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n",
    "# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n",
    "# SOFTWARE.\n",
    "\n",
    "\"\"\"Utilities for writing code that runs on Python 2 and 3\"\"\"\n",
    "\n",
    "from __future__ import absolute_import\n",
    "\n",
    "import functools\n",
    "import itertools\n",
    "import operator\n",
    "import sys\n",
    "import types\n",
    "\n",
    "__author__ = \"Benjamin Peterson <benjamin@python.org>\"\n",
    "__version__ = \"1.15.0\"\n",
    "\n",
    "\n",
    "# Useful for very coarse version differentiation.\n",
    "PY2 = sys.version_info[0] == 2\n",
    "PY3 = sys.version_info[0] == 3\n",
    "PY34 = sys.version_info[0:2] >= (3, 4)\n",
    "\n",
    "if PY3:\n",
    "    string_types = str,\n",
    "    integer_types = int,\n",
    "    class_types = type,\n",
    "    text_type = str\n",
    "    binary_type = bytes\n",
    "\n",
    "    MAXSIZE = sys.maxsize\n",
    "else:\n",
    "    string_types = basestring,\n",
    "    integer_types = (int, long)\n",
    "    class_types = (type, types.ClassType)\n",
    "    text_type = unicode\n",
    "    binary_type = str\n",
    "\n",
    "    if sys.platform.startswith(\"java\"):\n",
    "        # Jython always uses 32 bits.\n",
    "        MAXSIZE = int((1 << 31) - 1)\n",
    "    else:\n",
    "        # It's possible to have sizeof(long) != sizeof(Py_ssize_t).\n",
    "        class X(object):\n",
    "\n",
    "            def __len__(self):\n",
    "                return 1 << 31\n",
    "        try:\n",
    "            len(X())\n",
    "        except OverflowError:\n",
    "            # 32-bit\n",
    "            MAXSIZE = int((1 << 31) - 1)\n",
    "        else:\n",
    "            # 64-bit\n",
    "            MAXSIZE = int((1 << 63) - 1)\n",
    "        del X\n",
    "\n",
    "\n",
    "def _add_doc(func, doc):\n",
    "    \"\"\"Add documentation to a function.\"\"\"\n",
    "    func.__doc__ = doc\n",
    "\n",
    "\n",
    "def _import_module(name):\n",
    "    \"\"\"Import module, returning the module after the last dot.\"\"\"\n",
    "    __import__(name)\n",
    "    return sys.modules[name]\n",
    "\n",
    "\n",
    "class _LazyDescr(object):\n",
    "\n",
    "    def __init__(self, name):\n",
    "        self.name = name\n",
    "\n",
    "    def __get__(self, obj, tp):\n",
    "        result = self._resolve()\n",
    "        setattr(obj, self.name, result)  # Invokes __set__.\n",
    "        try:\n",
    "            # This is a bit ugly, but it avoids running this again by\n",
    "            # removing this descriptor.\n",
    "            delattr(obj.__class__, self.name)\n",
    "        except AttributeError:\n",
    "            pass\n",
    "        return result\n",
    "\n",
    "\n",
    "class MovedModule(_LazyDescr):\n",
    "\n",
    "    def __init__(self, name, old, new=None):\n",
    "        super(MovedModule, self).__init__(name)\n",
    "        if PY3:\n",
    "            if new is None:\n",
    "                new = name\n",
    "            self.mod = new\n",
    "        else:\n",
    "            self.mod = old\n",
    "\n",
    "    def _resolve(self):\n",
    "        return _import_module(self.mod)\n",
    "\n",
    "    def __getattr__(self, attr):\n",
    "        _module = self._resolve()\n",
    "        value = getattr(_module, attr)\n",
    "        setattr(self, attr, value)\n",
    "        return value\n",
    "\n",
    "\n",
    "class _LazyModule(types.ModuleType):\n",
    "\n",
    "    def __init__(self, name):\n",
    "        super(_LazyModule, self).__init__(name)\n",
    "        self.__doc__ = self.__class__.__doc__\n",
    "\n",
    "    def __dir__(self):\n",
    "        attrs = [\"__doc__\", \"__name__\"]\n",
    "        attrs += [attr.name for attr in self._moved_attributes]\n",
    "        return attrs\n",
    "\n",
    "    # Subclasses should override this\n",
    "    _moved_attributes = []\n",
    "\n",
    "\n",
    "class MovedAttribute(_LazyDescr):\n",
    "\n",
    "    def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):\n",
    "        super(MovedAttribute, self).__init__(name)\n",
    "        if PY3:\n",
    "            if new_mod is None:\n",
    "                new_mod = name\n",
    "            self.mod = new_mod\n",
    "            if new_attr is None:\n",
    "                if old_attr is None:\n",
    "                    new_attr = name\n",
    "                else:\n",
    "                    new_attr = old_attr\n",
    "            self.attr = new_attr\n",
    "        else:\n",
    "            self.mod = old_mod\n",
    "            if old_attr is None:\n",
    "                old_attr = name\n",
    "            self.attr = old_attr\n",
    "\n",
    "    def _resolve(self):\n",
    "        module = _import_module(self.mod)\n",
    "        return getattr(module, self.attr)\n",
    "\n",
    "\n",
    "class _SixMetaPathImporter(object):\n",
    "\n",
    "    \"\"\"\n",
    "    A meta path importer to import six.moves and its submodules.\n",
    "\n",
    "    This class implements a PEP302 finder and loader. It should be compatible\n",
    "    with Python 2.5 and all existing versions of Python3\n",
    "    \"\"\"\n",
    "\n",
    "    def __init__(self, six_module_name):\n",
    "        self.name = six_module_name\n",
    "        self.known_modules = {}\n",
    "\n",
    "    def _add_module(self, mod, *fullnames):\n",
    "        for fullname in fullnames:\n",
    "            self.known_modules[self.name + \".\" + fullname] = mod\n",
    "\n",
    "    def _get_module(self, fullname):\n",
    "        return self.known_modules[self.name + \".\" + fullname]\n",
    "\n",
    "    def find_module(self, fullname, path=None):\n",
    "        if fullname in self.known_modules:\n",
    "            return self\n",
    "        return None\n",
    "\n",
    "    def __get_module(self, fullname):\n",
    "        try:\n",
    "            return self.known_modules[fullname]\n",
    "        except KeyError:\n",
    "            raise ImportError(\"This loader does not know module \" + fullname)\n",
    "\n",
    "    def load_module(self, fullname):\n",
    "        try:\n",
    "            # in case of a reload\n",
    "            return sys.modules[fullname]\n",
    "        except KeyError:\n",
    "            pass\n",
    "        mod = self.__get_module(fullname)\n",
    "        if isinstance(mod, MovedModule):\n",
    "            mod = mod._resolve()\n",
    "        else:\n",
    "            mod.__loader__ = self\n",
    "        sys.modules[fullname] = mod\n",
    "        return mod\n",
    "\n",
    "    def is_package(self, fullname):\n",
    "        \"\"\"\n",
    "        Return true, if the named module is a package.\n",
    "\n",
    "        We need this method to get correct spec objects with\n",
    "        Python 3.4 (see PEP451)\n",
    "        \"\"\"\n",
    "        return hasattr(self.__get_module(fullname), \"__path__\")\n",
    "\n",
    "    def get_code(self, fullname):\n",
    "        \"\"\"Return None\n",
    "\n",
    "        Required, if is_package is implemented\"\"\"\n",
    "        self.__get_module(fullname)  # eventually raises ImportError\n",
    "        return None\n",
    "    get_source = get_code  # same as get_code\n",
    "\n",
    "_importer = _SixMetaPathImporter(__name__)\n",
    "\n",
    "\n",
    "class _MovedItems(_LazyModule):\n",
    "\n",
    "    \"\"\"Lazy loading of moved objects\"\"\"\n",
    "    __path__ = []  # mark as package\n",
    "\n",
    "\n",
    "_moved_attributes = [\n",
    "    MovedAttribute(\"cStringIO\", \"cStringIO\", \"io\", \"StringIO\"),\n",
    "    MovedAttribute(\"filter\", \"itertools\", \"builtins\", \"ifilter\", \"filter\"),\n",
    "    MovedAttribute(\"filterfalse\", \"itertools\", \"itertools\", \"ifilterfalse\", \"filterfalse\"),\n",
    "    MovedAttribute(\"input\", \"__builtin__\", \"builtins\", \"raw_input\", \"input\"),\n",
    "    MovedAttribute(\"intern\", \"__builtin__\", \"sys\"),\n",
    "    MovedAttribute(\"map\", \"itertools\", \"builtins\", \"imap\", \"map\"),\n",
    "    MovedAttribute(\"getcwd\", \"os\", \"os\", \"getcwdu\", \"getcwd\"),\n",
    "    MovedAttribute(\"getcwdb\", \"os\", \"os\", \"getcwd\", \"getcwdb\"),\n",
    "    MovedAttribute(\"getoutput\", \"commands\", \"subprocess\"),\n",
    "    MovedAttribute(\"range\", \"__builtin__\", \"builtins\", \"xrange\", \"range\"),\n",
    "    MovedAttribute(\"reload_module\", \"__builtin__\", \"importlib\" if PY34 else \"imp\", \"reload\"),\n",
    "    MovedAttribute(\"reduce\", \"__builtin__\", \"functools\"),\n",
    "    MovedAttribute(\"shlex_quote\", \"pipes\", \"shlex\", \"quote\"),\n",
    "    MovedAttribute(\"StringIO\", \"StringIO\", \"io\"),\n",
    "    MovedAttribute(\"UserDict\", \"UserDict\", \"collections\"),\n",
    "    MovedAttribute(\"UserList\", \"UserList\", \"collections\"),\n",
    "    MovedAttribute(\"UserString\", \"UserString\", \"collections\"),\n",
    "    MovedAttribute(\"xrange\", \"__builtin__\", \"builtins\", \"xrange\", \"range\"),\n",
    "    MovedAttribute(\"zip\", \"itertools\", \"builtins\", \"izip\", \"zip\"),\n",
    "    MovedAttribute(\"zip_longest\", \"itertools\", \"itertools\", \"izip_longest\", \"zip_longest\"),\n",
    "    MovedModule(\"builtins\", \"__builtin__\"),\n",
    "    MovedModule(\"configparser\", \"ConfigParser\"),\n",
    "    MovedModule(\"collections_abc\", \"collections\", \"collections.abc\" if sys.version_info >= (3, 3) else \"collections\"),\n",
    "    MovedModule(\"copyreg\", \"copy_reg\"),\n",
    "    MovedModule(\"dbm_gnu\", \"gdbm\", \"dbm.gnu\"),\n",
    "    MovedModule(\"dbm_ndbm\", \"dbm\", \"dbm.ndbm\"),\n",
    "    MovedModule(\"_dummy_thread\", \"dummy_thread\", \"_dummy_thread\" if sys.version_info < (3, 9) else \"_thread\"),\n",
    "    MovedModule(\"http_cookiejar\", \"cookielib\", \"http.cookiejar\"),\n",
    "    MovedModule(\"http_cookies\", \"Cookie\", \"http.cookies\"),\n",
    "    MovedModule(\"html_entities\", \"htmlentitydefs\", \"html.entities\"),\n",
    "    MovedModule(\"html_parser\", \"HTMLParser\", \"html.parser\"),\n",
    "    MovedModule(\"http_client\", \"httplib\", \"http.client\"),\n",
    "    MovedModule(\"email_mime_base\", \"email.MIMEBase\", \"email.mime.base\"),\n",
    "    MovedModule(\"email_mime_image\", \"email.MIMEImage\", \"email.mime.image\"),\n",
    "    MovedModule(\"email_mime_multipart\", \"email.MIMEMultipart\", \"email.mime.multipart\"),\n",
    "    MovedModule(\"email_mime_nonmultipart\", \"email.MIMENonMultipart\", \"email.mime.nonmultipart\"),\n",
    "    MovedModule(\"email_mime_text\", \"email.MIMEText\", \"email.mime.text\"),\n",
    "    MovedModule(\"BaseHTTPServer\", \"BaseHTTPServer\", \"http.server\"),\n",
    "    MovedModule(\"CGIHTTPServer\", \"CGIHTTPServer\", \"http.server\"),\n",
    "    MovedModule(\"SimpleHTTPServer\", \"SimpleHTTPServer\", \"http.server\"),\n",
    "    MovedModule(\"cPickle\", \"cPickle\", \"pickle\"),\n",
    "    MovedModule(\"queue\", \"Queue\"),\n",
    "    MovedModule(\"reprlib\", \"repr\"),\n",
    "    MovedModule(\"socketserver\", \"SocketServer\"),\n",
    "    MovedModule(\"_thread\", \"thread\", \"_thread\"),\n",
    "    MovedModule(\"tkinter\", \"Tkinter\"),\n",
    "    MovedModule(\"tkinter_dialog\", \"Dialog\", \"tkinter.dialog\"),\n",
    "    MovedModule(\"tkinter_filedialog\", \"FileDialog\", \"tkinter.filedialog\"),\n",
    "    MovedModule(\"tkinter_scrolledtext\", \"ScrolledText\", \"tkinter.scrolledtext\"),\n",
    "    MovedModule(\"tkinter_simpledialog\", \"SimpleDialog\", \"tkinter.simpledialog\"),\n",
    "    MovedModule(\"tkinter_tix\", \"Tix\", \"tkinter.tix\"),\n",
    "    MovedModule(\"tkinter_ttk\", \"ttk\", \"tkinter.ttk\"),\n",
    "    MovedModule(\"tkinter_constants\", \"Tkconstants\", \"tkinter.constants\"),\n",
    "    MovedModule(\"tkinter_dnd\", \"Tkdnd\", \"tkinter.dnd\"),\n",
    "    MovedModule(\"tkinter_colorchooser\", \"tkColorChooser\",\n",
    "                \"tkinter.colorchooser\"),\n",
    "    MovedModule(\"tkinter_commondialog\", \"tkCommonDialog\",\n",
    "                \"tkinter.commondialog\"),\n",
    "    MovedModule(\"tkinter_tkfiledialog\", \"tkFileDialog\", \"tkinter.filedialog\"),\n",
    "    MovedModule(\"tkinter_font\", \"tkFont\", \"tkinter.font\"),\n",
    "    MovedModule(\"tkinter_messagebox\", \"tkMessageBox\", \"tkinter.messagebox\"),\n",
    "    MovedModule(\"tkinter_tksimpledialog\", \"tkSimpleDialog\",\n",
    "                \"tkinter.simpledialog\"),\n",
    "    MovedModule(\"urllib_parse\", __name__ + \".moves.urllib_parse\", \"urllib.parse\"),\n",
    "    MovedModule(\"urllib_error\", __name__ + \".moves.urllib_error\", \"urllib.error\"),\n",
    "    MovedModule(\"urllib\", __name__ + \".moves.urllib\", __name__ + \".moves.urllib\"),\n",
    "    MovedModule(\"urllib_robotparser\", \"robotparser\", \"urllib.robotparser\"),\n",
    "    MovedModule(\"xmlrpc_client\", \"xmlrpclib\", \"xmlrpc.client\"),\n",
    "    MovedModule(\"xmlrpc_server\", \"SimpleXMLRPCServer\", \"xmlrpc.server\"),\n",
    "]\n",
    "# Add windows specific modules.\n",
    "if sys.platform == \"win32\":\n",
    "    _moved_attributes += [\n",
    "        MovedModule(\"winreg\", \"_winreg\"),\n",
    "    ]\n",
    "\n",
    "for attr in _moved_attributes:\n",
    "    setattr(_MovedItems, attr.name, attr)\n",
    "    if isinstance(attr, MovedModule):\n",
    "        _importer._add_module(attr, \"moves.\" + attr.name)\n",
    "del attr\n",
    "\n",
    "_MovedItems._moved_attributes = _moved_attributes\n",
    "\n",
    "moves = _MovedItems(__name__ + \".moves\")\n",
    "_importer._add_module(moves, \"moves\")\n",
    "\n",
    "\n",
    "class Module_six_moves_urllib_parse(_LazyModule):\n",
    "\n",
    "    \"\"\"Lazy loading of moved objects in six.moves.urllib_parse\"\"\"\n",
    "\n",
    "\n",
    "_urllib_parse_moved_attributes = [\n",
    "    MovedAttribute(\"ParseResult\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"SplitResult\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"parse_qs\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"parse_qsl\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"urldefrag\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"urljoin\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"urlparse\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"urlsplit\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"urlunparse\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"urlunsplit\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"quote\", \"urllib\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"quote_plus\", \"urllib\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"unquote\", \"urllib\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"unquote_plus\", \"urllib\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"unquote_to_bytes\", \"urllib\", \"urllib.parse\", \"unquote\", \"unquote_to_bytes\"),\n",
    "    MovedAttribute(\"urlencode\", \"urllib\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"splitquery\", \"urllib\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"splittag\", \"urllib\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"splituser\", \"urllib\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"splitvalue\", \"urllib\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"uses_fragment\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"uses_netloc\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"uses_params\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"uses_query\", \"urlparse\", \"urllib.parse\"),\n",
    "    MovedAttribute(\"uses_relative\", \"urlparse\", \"urllib.parse\"),\n",
    "]\n",
    "for attr in _urllib_parse_moved_attributes:\n",
    "    setattr(Module_six_moves_urllib_parse, attr.name, attr)\n",
    "del attr\n",
    "\n",
    "Module_six_moves_urllib_parse._moved_attributes = _urllib_parse_moved_attributes\n",
    "\n",
    "_importer._add_module(Module_six_moves_urllib_parse(__name__ + \".moves.urllib_parse\"),\n",
    "                      \"moves.urllib_parse\", \"moves.urllib.parse\")\n",
    "\n",
    "\n",
    "class Module_six_moves_urllib_error(_LazyModule):\n",
    "\n",
    "    \"\"\"Lazy loading of moved objects in six.moves.urllib_error\"\"\"\n",
    "\n",
    "\n",
    "_urllib_error_moved_attributes = [\n",
    "    MovedAttribute(\"URLError\", \"urllib2\", \"urllib.error\"),\n",
    "    MovedAttribute(\"HTTPError\", \"urllib2\", \"urllib.error\"),\n",
    "    MovedAttribute(\"ContentTooShortError\", \"urllib\", \"urllib.error\"),\n",
    "]\n",
    "for attr in _urllib_error_moved_attributes:\n",
    "    setattr(Module_six_moves_urllib_error, attr.name, attr)\n",
    "del attr\n",
    "\n",
    "Module_six_moves_urllib_error._moved_attributes = _urllib_error_moved_attributes\n",
    "\n",
    "_importer._add_module(Module_six_moves_urllib_error(__name__ + \".moves.urllib.error\"),\n",
    "                      \"moves.urllib_error\", \"moves.urllib.error\")\n",
    "\n",
    "\n",
    "class Module_six_moves_urllib_request(_LazyModule):\n",
    "\n",
    "    \"\"\"Lazy loading of moved objects in six.moves.urllib_request\"\"\"\n",
    "\n",
    "\n",
    "_urllib_request_moved_attributes = [\n",
    "    MovedAttribute(\"urlopen\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"install_opener\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"build_opener\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"pathname2url\", \"urllib\", \"urllib.request\"),\n",
    "    MovedAttribute(\"url2pathname\", \"urllib\", \"urllib.request\"),\n",
    "    MovedAttribute(\"getproxies\", \"urllib\", \"urllib.request\"),\n",
    "    MovedAttribute(\"Request\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"OpenerDirector\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"HTTPDefaultErrorHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"HTTPRedirectHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"HTTPCookieProcessor\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"ProxyHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"BaseHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"HTTPPasswordMgr\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"HTTPPasswordMgrWithDefaultRealm\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"AbstractBasicAuthHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"HTTPBasicAuthHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"ProxyBasicAuthHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"AbstractDigestAuthHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"HTTPDigestAuthHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"ProxyDigestAuthHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"HTTPHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"HTTPSHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"FileHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"FTPHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"CacheFTPHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"UnknownHandler\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"HTTPErrorProcessor\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"urlretrieve\", \"urllib\", \"urllib.request\"),\n",
    "    MovedAttribute(\"urlcleanup\", \"urllib\", \"urllib.request\"),\n",
    "    MovedAttribute(\"URLopener\", \"urllib\", \"urllib.request\"),\n",
    "    MovedAttribute(\"FancyURLopener\", \"urllib\", \"urllib.request\"),\n",
    "    MovedAttribute(\"proxy_bypass\", \"urllib\", \"urllib.request\"),\n",
    "    MovedAttribute(\"parse_http_list\", \"urllib2\", \"urllib.request\"),\n",
    "    MovedAttribute(\"parse_keqv_list\", \"urllib2\", \"urllib.request\"),\n",
    "]\n",
    "for attr in _urllib_request_moved_attributes:\n",
    "    setattr(Module_six_moves_urllib_request, attr.name, attr)\n",
    "del attr\n",
    "\n",
    "Module_six_moves_urllib_request._moved_attributes = _urllib_request_moved_attributes\n",
    "\n",
    "_importer._add_module(Module_six_moves_urllib_request(__name__ + \".moves.urllib.request\"),\n",
    "                      \"moves.urllib_request\", \"moves.urllib.request\")\n",
    "\n",
    "\n",
    "class Module_six_moves_urllib_response(_LazyModule):\n",
    "\n",
    "    \"\"\"Lazy loading of moved objects in six.moves.urllib_response\"\"\"\n",
    "\n",
    "\n",
    "_urllib_response_moved_attributes = [\n",
    "    MovedAttribute(\"addbase\", \"urllib\", \"urllib.response\"),\n",
    "    MovedAttribute(\"addclosehook\", \"urllib\", \"urllib.response\"),\n",
    "    MovedAttribute(\"addinfo\", \"urllib\", \"urllib.response\"),\n",
    "    MovedAttribute(\"addinfourl\", \"urllib\", \"urllib.response\"),\n",
    "]\n",
    "for attr in _urllib_response_moved_attributes:\n",
    "    setattr(Module_six_moves_urllib_response, attr.name, attr)\n",
    "del attr\n",
    "\n",
    "Module_six_moves_urllib_response._moved_attributes = _urllib_response_moved_attributes\n",
    "\n",
    "_importer._add_module(Module_six_moves_urllib_response(__name__ + \".moves.urllib.response\"),\n",
    "                      \"moves.urllib_response\", \"moves.urllib.response\")\n",
    "\n",
    "\n",
    "class Module_six_moves_urllib_robotparser(_LazyModule):\n",
    "\n",
    "    \"\"\"Lazy loading of moved objects in six.moves.urllib_robotparser\"\"\"\n",
    "\n",
    "\n",
    "_urllib_robotparser_moved_attributes = [\n",
    "    MovedAttribute(\"RobotFileParser\", \"robotparser\", \"urllib.robotparser\"),\n",
    "]\n",
    "for attr in _urllib_robotparser_moved_attributes:\n",
    "    setattr(Module_six_moves_urllib_robotparser, attr.name, attr)\n",
    "del attr\n",
    "\n",
    "Module_six_moves_urllib_robotparser._moved_attributes = _urllib_robotparser_moved_attributes\n",
    "\n",
    "_importer._add_module(Module_six_moves_urllib_robotparser(__name__ + \".moves.urllib.robotparser\"),\n",
    "                      \"moves.urllib_robotparser\", \"moves.urllib.robotparser\")\n",
    "\n",
    "\n",
    "class Module_six_moves_urllib(types.ModuleType):\n",
    "\n",
    "    \"\"\"Create a six.moves.urllib namespace that resembles the Python 3 namespace\"\"\"\n",
    "    __path__ = []  # mark as package\n",
    "    parse = _importer._get_module(\"moves.urllib_parse\")\n",
    "    error = _importer._get_module(\"moves.urllib_error\")\n",
    "    request = _importer._get_module(\"moves.urllib_request\")\n",
    "    response = _importer._get_module(\"moves.urllib_response\")\n",
    "    robotparser = _importer._get_module(\"moves.urllib_robotparser\")\n",
    "\n",
    "    def __dir__(self):\n",
    "        return ['parse', 'error', 'request', 'response', 'robotparser']\n",
    "\n",
    "_importer._add_module(Module_six_moves_urllib(__name__ + \".moves.urllib\"),\n",
    "                      \"moves.urllib\")\n",
    "\n",
    "\n",
    "def add_move(move):\n",
    "    \"\"\"Add an item to six.moves.\"\"\"\n",
    "    setattr(_MovedItems, move.name, move)\n",
    "\n",
    "\n",
    "def remove_move(name):\n",
    "    \"\"\"Remove item from six.moves.\"\"\"\n",
    "    try:\n",
    "        delattr(_MovedItems, name)\n",
    "    except AttributeError:\n",
    "        try:\n",
    "            del moves.__dict__[name]\n",
    "        except KeyError:\n",
    "            raise AttributeError(\"no such move, %r\" % (name,))\n",
    "\n",
    "\n",
    "if PY3:\n",
    "    _meth_func = \"__func__\"\n",
    "    _meth_self = \"__self__\"\n",
    "\n",
    "    _func_closure = \"__closure__\"\n",
    "    _func_code = \"__code__\"\n",
    "    _func_defaults = \"__defaults__\"\n",
    "    _func_globals = \"__globals__\"\n",
    "else:\n",
    "    _meth_func = \"im_func\"\n",
    "    _meth_self = \"im_self\"\n",
    "\n",
    "    _func_closure = \"func_closure\"\n",
    "    _func_code = \"func_code\"\n",
    "    _func_defaults = \"func_defaults\"\n",
    "    _func_globals = \"func_globals\"\n",
    "\n",
    "\n",
    "try:\n",
    "    advance_iterator = next\n",
    "except NameError:\n",
    "    def advance_iterator(it):\n",
    "        return it.next()\n",
    "next = advance_iterator\n",
    "\n",
    "\n",
    "try:\n",
    "    callable = callable\n",
    "except NameError:\n",
    "    def callable(obj):\n",
    "        return any(\"__call__\" in klass.__dict__ for klass in type(obj).__mro__)\n",
    "\n",
    "\n",
    "if PY3:\n",
    "    def get_unbound_function(unbound):\n",
    "        return unbound\n",
    "\n",
    "    create_bound_method = types.MethodType\n",
    "\n",
    "    def create_unbound_method(func, cls):\n",
    "        return func\n",
    "\n",
    "    Iterator = object\n",
    "else:\n",
    "    def get_unbound_function(unbound):\n",
    "        return unbound.im_func\n",
    "\n",
    "    def create_bound_method(func, obj):\n",
    "        return types.MethodType(func, obj, obj.__class__)\n",
    "\n",
    "    def create_unbound_method(func, cls):\n",
    "        return types.MethodType(func, None, cls)\n",
    "\n",
    "    class Iterator(object):\n",
    "\n",
    "        def next(self):\n",
    "            return type(self).__next__(self)\n",
    "\n",
    "    callable = callable\n",
    "_add_doc(get_unbound_function,\n",
    "         \"\"\"Get the function out of a possibly unbound function\"\"\")\n",
    "\n",
    "\n",
    "get_method_function = operator.attrgetter(_meth_func)\n",
    "get_method_self = operator.attrgetter(_meth_self)\n",
    "get_function_closure = operator.attrgetter(_func_closure)\n",
    "get_function_code = operator.attrgetter(_func_code)\n",
    "get_function_defaults = operator.attrgetter(_func_defaults)\n",
    "get_function_globals = operator.attrgetter(_func_globals)\n",
    "\n",
    "\n",
    "if PY3:\n",
    "    def iterkeys(d, **kw):\n",
    "        return iter(d.keys(**kw))\n",
    "\n",
    "    def itervalues(d, **kw):\n",
    "        return iter(d.values(**kw))\n",
    "\n",
    "    def iteritems(d, **kw):\n",
    "        return iter(d.items(**kw))\n",
    "\n",
    "    def iterlists(d, **kw):\n",
    "        return iter(d.lists(**kw))\n",
    "\n",
    "    viewkeys = operator.methodcaller(\"keys\")\n",
    "\n",
    "    viewvalues = operator.methodcaller(\"values\")\n",
    "\n",
    "    viewitems = operator.methodcaller(\"items\")\n",
    "else:\n",
    "    def iterkeys(d, **kw):\n",
    "        return d.iterkeys(**kw)\n",
    "\n",
    "    def itervalues(d, **kw):\n",
    "        return d.itervalues(**kw)\n",
    "\n",
    "    def iteritems(d, **kw):\n",
    "        return d.iteritems(**kw)\n",
    "\n",
    "    def iterlists(d, **kw):\n",
    "        return d.iterlists(**kw)\n",
    "\n",
    "    viewkeys = operator.methodcaller(\"viewkeys\")\n",
    "\n",
    "    viewvalues = operator.methodcaller(\"viewvalues\")\n",
    "\n",
    "    viewitems = operator.methodcaller(\"viewitems\")\n",
    "\n",
    "_add_doc(iterkeys, \"Return an iterator over the keys of a dictionary.\")\n",
    "_add_doc(itervalues, \"Return an iterator over the values of a dictionary.\")\n",
    "_add_doc(iteritems,\n",
    "         \"Return an iterator over the (key, value) pairs of a dictionary.\")\n",
    "_add_doc(iterlists,\n",
    "         \"Return an iterator over the (key, [values]) pairs of a dictionary.\")\n",
    "\n",
    "\n",
    "if PY3:\n",
    "    def b(s):\n",
    "        return s.encode(\"latin-1\")\n",
    "\n",
    "    def u(s):\n",
    "        return s\n",
    "    unichr = chr\n",
    "    import struct\n",
    "    int2byte = struct.Struct(\">B\").pack\n",
    "    del struct\n",
    "    byte2int = operator.itemgetter(0)\n",
    "    indexbytes = operator.getitem\n",
    "    iterbytes = iter\n",
    "    import io\n",
    "    StringIO = io.StringIO\n",
    "    BytesIO = io.BytesIO\n",
    "    del io\n",
    "    _assertCountEqual = \"assertCountEqual\"\n",
    "    if sys.version_info[1] <= 1:\n",
    "        _assertRaisesRegex = \"assertRaisesRegexp\"\n",
    "        _assertRegex = \"assertRegexpMatches\"\n",
    "        _assertNotRegex = \"assertNotRegexpMatches\"\n",
    "    else:\n",
    "        _assertRaisesRegex = \"assertRaisesRegex\"\n",
    "        _assertRegex = \"assertRegex\"\n",
    "        _assertNotRegex = \"assertNotRegex\"\n",
    "else:\n",
    "    def b(s):\n",
    "        return s\n",
    "    # Workaround for standalone backslash\n",
    "\n",
    "    def u(s):\n",
    "        return unicode(s.replace(r'\\\\', r'\\\\\\\\'), \"unicode_escape\")\n",
    "    unichr = unichr\n",
    "    int2byte = chr\n",
    "\n",
    "    def byte2int(bs):\n",
    "        return ord(bs[0])\n",
    "\n",
    "    def indexbytes(buf, i):\n",
    "        return ord(buf[i])\n",
    "    iterbytes = functools.partial(itertools.imap, ord)\n",
    "    import StringIO\n",
    "    StringIO = BytesIO = StringIO.StringIO\n",
    "    _assertCountEqual = \"assertItemsEqual\"\n",
    "    _assertRaisesRegex = \"assertRaisesRegexp\"\n",
    "    _assertRegex = \"assertRegexpMatches\"\n",
    "    _assertNotRegex = \"assertNotRegexpMatches\"\n",
    "_add_doc(b, \"\"\"Byte literal\"\"\")\n",
    "_add_doc(u, \"\"\"Text literal\"\"\")\n",
    "\n",
    "\n",
    "def assertCountEqual(self, *args, **kwargs):\n",
    "    return getattr(self, _assertCountEqual)(*args, **kwargs)\n",
    "\n",
    "\n",
    "def assertRaisesRegex(self, *args, **kwargs):\n",
    "    return getattr(self, _assertRaisesRegex)(*args, **kwargs)\n",
    "\n",
    "\n",
    "def assertRegex(self, *args, **kwargs):\n",
    "    return getattr(self, _assertRegex)(*args, **kwargs)\n",
    "\n",
    "\n",
    "def assertNotRegex(self, *args, **kwargs):\n",
    "    return getattr(self, _assertNotRegex)(*args, **kwargs)\n",
    "\n",
    "\n",
    "if PY3:\n",
    "    exec_ = getattr(moves.builtins, \"exec\")\n",
    "\n",
    "    def reraise(tp, value, tb=None):\n",
    "        try:\n",
    "            if value is None:\n",
    "                value = tp()\n",
    "            if value.__traceback__ is not tb:\n",
    "                raise value.with_traceback(tb)\n",
    "            raise value\n",
    "        finally:\n",
    "            value = None\n",
    "            tb = None\n",
    "\n",
    "else:\n",
    "    def exec_(_code_, _globs_=None, _locs_=None):\n",
    "        \"\"\"Execute code in a namespace.\"\"\"\n",
    "        if _globs_ is None:\n",
    "            frame = sys._getframe(1)\n",
    "            _globs_ = frame.f_globals\n",
    "            if _locs_ is None:\n",
    "                _locs_ = frame.f_locals\n",
    "            del frame\n",
    "        elif _locs_ is None:\n",
    "            _locs_ = _globs_\n",
    "        exec(\"\"\"exec _code_ in _globs_, _locs_\"\"\")\n",
    "\n",
    "    exec_(\"\"\"def reraise(tp, value, tb=None):\n",
    "    try:\n",
    "        raise tp, value, tb\n",
    "    finally:\n",
    "        tb = None\n",
    "\"\"\")\n",
    "\n",
    "\n",
    "if sys.version_info[:2] > (3,):\n",
    "    exec_(\"\"\"def raise_from(value, from_value):\n",
    "    try:\n",
    "        raise value from from_value\n",
    "    finally:\n",
    "        value = None\n",
    "\"\"\")\n",
    "else:\n",
    "    def raise_from(value, from_value):\n",
    "        raise value\n",
    "\n",
    "\n",
    "print_ = getattr(moves.builtins, \"print\", None)\n",
    "if print_ is None:\n",
    "    def print_(*args, **kwargs):\n",
    "        \"\"\"The new-style print function for Python 2.4 and 2.5.\"\"\"\n",
    "        fp = kwargs.pop(\"file\", sys.stdout)\n",
    "        if fp is None:\n",
    "            return\n",
    "\n",
    "        def write(data):\n",
    "            if not isinstance(data, basestring):\n",
    "                data = str(data)\n",
    "            # If the file has an encoding, encode unicode with it.\n",
    "            if (isinstance(fp, file) and\n",
    "                    isinstance(data, unicode) and\n",
    "                    fp.encoding is not None):\n",
    "                errors = getattr(fp, \"errors\", None)\n",
    "                if errors is None:\n",
    "                    errors = \"strict\"\n",
    "                data = data.encode(fp.encoding, errors)\n",
    "            fp.write(data)\n",
    "        want_unicode = False\n",
    "        sep = kwargs.pop(\"sep\", None)\n",
    "        if sep is not None:\n",
    "            if isinstance(sep, unicode):\n",
    "                want_unicode = True\n",
    "            elif not isinstance(sep, str):\n",
    "                raise TypeError(\"sep must be None or a string\")\n",
    "        end = kwargs.pop(\"end\", None)\n",
    "        if end is not None:\n",
    "            if isinstance(end, unicode):\n",
    "                want_unicode = True\n",
    "            elif not isinstance(end, str):\n",
    "                raise TypeError(\"end must be None or a string\")\n",
    "        if kwargs:\n",
    "            raise TypeError(\"invalid keyword arguments to print()\")\n",
    "        if not want_unicode:\n",
    "            for arg in args:\n",
    "                if isinstance(arg, unicode):\n",
    "                    want_unicode = True\n",
    "                    break\n",
    "        if want_unicode:\n",
    "            newline = unicode(\"\\n\")\n",
    "            space = unicode(\" \")\n",
    "        else:\n",
    "            newline = \"\\n\"\n",
    "            space = \" \"\n",
    "        if sep is None:\n",
    "            sep = space\n",
    "        if end is None:\n",
    "            end = newline\n",
    "        for i, arg in enumerate(args):\n",
    "            if i:\n",
    "                write(sep)\n",
    "            write(arg)\n",
    "        write(end)\n",
    "if sys.version_info[:2] < (3, 3):\n",
    "    _print = print_\n",
    "\n",
    "    def print_(*args, **kwargs):\n",
    "        fp = kwargs.get(\"file\", sys.stdout)\n",
    "        flush = kwargs.pop(\"flush\", False)\n",
    "        _print(*args, **kwargs)\n",
    "        if flush and fp is not None:\n",
    "            fp.flush()\n",
    "\n",
    "_add_doc(reraise, \"\"\"Reraise an exception.\"\"\")\n",
    "\n",
    "if sys.version_info[0:2] < (3, 4):\n",
    "    # This does exactly the same what the :func:`py3:functools.update_wrapper`\n",
    "    # function does on Python versions after 3.2. It sets the ``__wrapped__``\n",
    "    # attribute on ``wrapper`` object and it doesn't raise an error if any of\n",
    "    # the attributes mentioned in ``assigned`` and ``updated`` are missing on\n",
    "    # ``wrapped`` object.\n",
    "    def _update_wrapper(wrapper, wrapped,\n",
    "                        assigned=functools.WRAPPER_ASSIGNMENTS,\n",
    "                        updated=functools.WRAPPER_UPDATES):\n",
    "        for attr in assigned:\n",
    "            try:\n",
    "                value = getattr(wrapped, attr)\n",
    "            except AttributeError:\n",
    "                continue\n",
    "            else:\n",
    "                setattr(wrapper, attr, value)\n",
    "        for attr in updated:\n",
    "            getattr(wrapper, attr).update(getattr(wrapped, attr, {}))\n",
    "        wrapper.__wrapped__ = wrapped\n",
    "        return wrapper\n",
    "    _update_wrapper.__doc__ = functools.update_wrapper.__doc__\n",
    "\n",
    "    def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS,\n",
    "              updated=functools.WRAPPER_UPDATES):\n",
    "        return functools.partial(_update_wrapper, wrapped=wrapped,\n",
    "                                 assigned=assigned, updated=updated)\n",
    "    wraps.__doc__ = functools.wraps.__doc__\n",
    "\n",
    "else:\n",
    "    wraps = functools.wraps\n",
    "\n",
    "\n",
    "def with_metaclass(meta, *bases):\n",
    "    \"\"\"Create a base class with a metaclass.\"\"\"\n",
    "    # This requires a bit of explanation: the basic idea is to make a dummy\n",
    "    # metaclass for one level of class instantiation that replaces itself with\n",
    "    # the actual metaclass.\n",
    "    class metaclass(type):\n",
    "\n",
    "        def __new__(cls, name, this_bases, d):\n",
    "            if sys.version_info[:2] >= (3, 7):\n",
    "                # This version introduced PEP 560 that requires a bit\n",
    "                # of extra care (we mimic what is done by __build_class__).\n",
    "                resolved_bases = types.resolve_bases(bases)\n",
    "                if resolved_bases is not bases:\n",
    "                    d['__orig_bases__'] = bases\n",
    "            else:\n",
    "                resolved_bases = bases\n",
    "            return meta(name, resolved_bases, d)\n",
    "\n",
    "        @classmethod\n",
    "        def __prepare__(cls, name, this_bases):\n",
    "            return meta.__prepare__(name, bases)\n",
    "    return type.__new__(metaclass, 'temporary_class', (), {})\n",
    "\n",
    "\n",
    "def add_metaclass(metaclass):\n",
    "    \"\"\"Class decorator for creating a class with a metaclass.\"\"\"\n",
    "    def wrapper(cls):\n",
    "        orig_vars = cls.__dict__.copy()\n",
    "        slots = orig_vars.get('__slots__')\n",
    "        if slots is not None:\n",
    "            if isinstance(slots, str):\n",
    "                slots = [slots]\n",
    "            for slots_var in slots:\n",
    "                orig_vars.pop(slots_var)\n",
    "        orig_vars.pop('__dict__', None)\n",
    "        orig_vars.pop('__weakref__', None)\n",
    "        if hasattr(cls, '__qualname__'):\n",
    "            orig_vars['__qualname__'] = cls.__qualname__\n",
    "        return metaclass(cls.__name__, cls.__bases__, orig_vars)\n",
    "    return wrapper\n",
    "\n",
    "\n",
    "def ensure_binary(s, encoding='utf-8', errors='strict'):\n",
    "    \"\"\"Coerce **s** to six.binary_type.\n",
    "\n",
    "    For Python 2:\n",
    "      - `unicode` -> encoded to `str`\n",
    "      - `str` -> `str`\n",
    "\n",
    "    For Python 3:\n",
    "      - `str` -> encoded to `bytes`\n",
    "      - `bytes` -> `bytes`\n",
    "    \"\"\"\n",
    "    if isinstance(s, binary_type):\n",
    "        return s\n",
    "    if isinstance(s, text_type):\n",
    "        return s.encode(encoding, errors)\n",
    "    raise TypeError(\"not expecting type '%s'\" % type(s))\n",
    "\n",
    "\n",
    "def ensure_str(s, encoding='utf-8', errors='strict'):\n",
    "    \"\"\"Coerce *s* to `str`.\n",
    "\n",
    "    For Python 2:\n",
    "      - `unicode` -> encoded to `str`\n",
    "      - `str` -> `str`\n",
    "\n",
    "    For Python 3:\n",
    "      - `str` -> `str`\n",
    "      - `bytes` -> decoded to `str`\n",
    "    \"\"\"\n",
    "    # Optimization: Fast return for the common case.\n",
    "    if type(s) is str:\n",
    "        return s\n",
    "    if PY2 and isinstance(s, text_type):\n",
    "        return s.encode(encoding, errors)\n",
    "    elif PY3 and isinstance(s, binary_type):\n",
    "        return s.decode(encoding, errors)\n",
    "    elif not isinstance(s, (text_type, binary_type)):\n",
    "        raise TypeError(\"not expecting type '%s'\" % type(s))\n",
    "    return s\n",
    "\n",
    "\n",
    "def ensure_text(s, encoding='utf-8', errors='strict'):\n",
    "    \"\"\"Coerce *s* to six.text_type.\n",
    "\n",
    "    For Python 2:\n",
    "      - `unicode` -> `unicode`\n",
    "      - `str` -> `unicode`\n",
    "\n",
    "    For Python 3:\n",
    "      - `str` -> `str`\n",
    "      - `bytes` -> decoded to `str`\n",
    "    \"\"\"\n",
    "    if isinstance(s, binary_type):\n",
    "        return s.decode(encoding, errors)\n",
    "    elif isinstance(s, text_type):\n",
    "        return s\n",
    "    else:\n",
    "        raise TypeError(\"not expecting type '%s'\" % type(s))\n",
    "\n",
    "\n",
    "def python_2_unicode_compatible(klass):\n",
    "    \"\"\"\n",
    "    A class decorator that defines __unicode__ and __str__ methods under Python 2.\n",
    "    Under Python 3 it does nothing.\n",
    "\n",
    "    To support Python 2 and 3 with a single code base, define a __str__ method\n",
    "    returning text and apply this decorator to the class.\n",
    "    \"\"\"\n",
    "    if PY2:\n",
    "        if '__str__' not in klass.__dict__:\n",
    "            raise ValueError(\"@python_2_unicode_compatible cannot be applied \"\n",
    "                             \"to %s because it doesn't define __str__().\" %\n",
    "                             klass.__name__)\n",
    "        klass.__unicode__ = klass.__str__\n",
    "        klass.__str__ = lambda self: self.__unicode__().encode('utf-8')\n",
    "    return klass\n",
    "\n",
    "\n",
    "# Complete the moves implementation.\n",
    "# This code is at the end of this module to speed up module loading.\n",
    "# Turn this module into a package.\n",
    "__path__ = []  # required for PEP 302 and PEP 451\n",
    "__package__ = __name__  # see PEP 366 @ReservedAssignment\n",
    "if globals().get(\"__spec__\") is not None:\n",
    "    __spec__.submodule_search_locations = []  # PEP 451 @UndefinedVariable\n",
    "# Remove other six meta path importers, since they cause problems. This can\n",
    "# happen if six is removed from sys.modules and then reloaded. (Setuptools does\n",
    "# this for some reason.)\n",
    "if sys.meta_path:\n",
    "    for i, importer in enumerate(sys.meta_path):\n",
    "        # Here's some real nastiness: Another \"instance\" of the six module might\n",
    "        # be floating around. Therefore, we can't use isinstance() to check for\n",
    "        # the six meta path importer, since the other six instance will have\n",
    "        # inserted an importer with different class.\n",
    "        if (type(importer).__name__ == \"_SixMetaPathImporter\" and\n",
    "                importer.name == __name__):\n",
    "            del sys.meta_path[i]\n",
    "            break\n",
    "    del i, importer\n",
    "# Finally, add the importer to the meta path import hook.\n",
    "sys.meta_path.append(_importer)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ]
}